package com.service;

import java.util.ArrayList;

import com.dao.MessageDao;
import com.model.Message;
import com.model.Users;

public class MessageService {
	private MessageDao messageDao;

	public MessageDao getMessageDao() {
		return messageDao;
	}

	public void setMessageDao(MessageDao messageDao) {
		this.messageDao = messageDao;
	}
	
	public ArrayList<Message> getAll(){
		return messageDao.getList_hibernate();
	}
	
	public void save(Message message){
		messageDao.insert_hibernate(message);
	}
	
	public void update(Message message) {
		messageDao.updateData_hibernate(message);
	}
	
	public Message found(int id) {
		return messageDao.found_hibernate(id);
	}
	
	public void delete(int id) {
		messageDao.delete_hibernate(id);
	}
}
